import Request from "@/util/request.js";

const apiRequest = new Request();

// 获取节点树 api/auth.node/tree
export const getNodeTreeApi = () => {
    return apiRequest.post("/api/auth.node/tree");
}

// read
export const getNodeApi = (params) => {
    return apiRequest.post("/api/auth.node/read", params);
}

// create
export const createNodeApic = (params) => {
    return apiRequest.post("/api/auth.node/create", params);
}

// save
export const saveNodeApi = (params) => {
    return apiRequest.post("/api/auth.node/save", params);
}

// delete
export const deleteNodeApi = (params) => {
    return apiRequest.post("/api/auth.node/delete", params);
}

// 获取系统菜单
export const getMenuApi = () => {
    return apiRequest.post("/api/auth.menu/index");
}

// 读取角色列表
export const getRoleListApi = () => {
    return apiRequest.post("/api/auth.role/index");
}

// picke
export const getRolePickApi = () => {
    return apiRequest.post("/api/auth.role/picker");
}

// 添加角色
export const createRoleApi = (params) => {
    return apiRequest.post("/api/auth.role/create", params);
}

// 读取角色
export const readRoleApi = (params) => {
    return apiRequest.post("/api/auth.role/read", params);
}

// 保存角色
export const saveRoleApi = (params) => {
    return apiRequest.post("/api/auth.role/save", params);
}

// 删除角色
export const deleteRoleApi = (params) => {
    return apiRequest.post("/api/auth.role/delete", params);
}
